package com.greatwqs.wmall.product.client.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/***
 * 商品扣减库存请求
 * @author wang-qingsong
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ProductSubStockRequest implements java.io.Serializable, Comparable<ProductSubStockRequest> {

    private Long productId;

    /**
     * 扣减库存数量 (正数)
     */
    private Integer subStock;

    /**
     * productId 从小到大排序进行扣库存
     */
    @Override
    public int compareTo(ProductSubStockRequest that) {
        return this.productId.compareTo(that.productId);
    }
}
